The art and science of three-dimensional (“3-D”) computer graphics concerns the generation and/or rendering of two-dimensional (“2-D”) images of 3-D objects for display or presentation onto a display device or monitor, such as a Cathode Ray Tube (CRT) or a Liquid Crystal Display (LCD). The object may be a simple geometry primitive such as a point, a line segment, a triangle, or a polygon. More complex objects can be rendered onto a display device by representing the objects with a series of connected planar polygons, such as, for example, by representing the objects as a series of connected planar triangles. All geometry primitives may eventually be described in terms of one vertex or a set of vertices. For example, a coordinate (X, Y, Z) that defines a point, can represent the endpoint of a line segment or a corner of a polygon.
To generate a data set for display as a 2-D projection representative of a 3-D primitive onto a computer monitor or other display device, the vertices of the primitive are processed through a series of operations, or processing stages in a graphics-rendering pipeline. A generic pipeline is merely a series of cascading processing units, or stages, wherein the output from a prior stage serves as the input for a subsequent stage. In the context of a graphics processor, these stages include, for example, per-vertex operations, primitive assembly operations, pixel operations, texture assembly operations, rasterization operations, and fragment operations.
In a typical graphics display system, an image database (e.g., a command list) may store a description of the objects in the scene. The objects are described with a number of small polygons, which cover the surface of the object in the same manner that a number of small tiles can cover a wall or other surface. Each polygon is described as a list of vertex coordinates (X, Y, Z in “Model” coordinates) and some specification of material surface properties (e.g., color, texture, shininess, etc.), as well as possibly the normal vectors to the surface at each vertex. For three-dimensional objects with complex curved surfaces, the polygons may include triangles and/or quadrilaterals, and the latter can be decomposed into pairs of triangles.
A transformation engine transforms the object coordinates in response to the angle of viewing selected by a user from user input. In addition, the user may specify the field of view, the size of the image to be produced, and the back end of the viewing volume so as to include or eliminate background as desired.
Once this viewing area has been selected, clipping logic eliminates the polygons (e.g., triangles), which are outside the viewing area, and “clips” the polygons, which are partly inside and partly outside the viewing area. These clipped polygons may correspond to the portion of the polygon inside the viewing area with new edge(s) corresponding to the edge(s) of the viewing area. The polygon vertices are then transmitted to the next stage in coordinates corresponding to the viewing screen (in X, Y coordinates) with an associated depth for each vertex (the Z coordinate). In a typical system, the lighting model is next applied taking into account the light sources. The polygons with their attribute values are then transmitted to a rasterizer.
For one or more of the polygons, the rasterizer determines which pixel positions are covered by the polygon and attempts to write the associated attribute values and depth (Z value) into a frame buffer. The rasterizer compares the depth values (Z) for the polygon being processed with the depth value of a pixel, which may already be written into the frame buffer. If the depth value of the new polygon pixel is smaller, indicating that it is in front of the polygon already written into the frame buffer, then its value may replace the value in the frame buffer because the new polygon will obscure the polygon previously processed and written into the frame buffer. This process is repeated until all of the polygons have been rasterized. At that point, the video controller displays the contents of a frame buffer on a display one scan line at a time in raster order.
The default methods of performing real-time rendering may display polygons as pixels located either inside or outside the actual edges of the polygon. The resulting edges, which define the polygon, can appear with a jagged look in a static display and a crawling look in an animated display. The underlying problem producing this effect is called aliasing and the methods applied to reduce or eliminate the problem are called anti-aliasing techniques.
One anti-aliasing technique adjusts pixel attributes where aliasing occurs in an attempt to smooth the display. For example, a pixel's intensity may depend on the length of the line segment that falls in the pixel's area. Screen-based anti-aliasing methods do not require knowledge of the objects being rendered because they use only the pipeline output samples. Another anti-aliasing method utilizes a line anti-aliasing technique called Multiple-Sample-Anti-Aliasing (MSAA), which takes more than one sample per pixel in a single pass. The number of samples or sub-pixels taken for each pixel is called the sampling rate and, axiomatically, as the sampling rate increases, the tile data amount and associated memory traffic increases. It must be noted that in practice the number of samples may vary. Although a higher sampling rate can produce better anti-aliasing, the demand on system resources increases in proportion to the sampling rate.
Three-dimensional data processing may be data intensive. Compression schemes for multisample data may be utilized to reduce the amount of data transferred between the graphics pipeline stages, as well as memory and the processor to improve performance. Thus, a heretofore-unaddressed need exists in the industry to address the aforementioned deficiencies and inadequacies.